<template>
  <el-form :inline="true" :model="formInline" class="demo-form-inline" >
    <el-form-item label="基金产品名称">
      <el-input v-model="formInline.itemDescription" placeholder="基金产品名称"></el-input>
    </el-form-item>
    <el-form-item label="购买金额">
      <el-input v-model="formInline.tradeMoney" placeholder="购买金额"></el-input>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">购买</el-button>
    </el-form-item>
  </el-form>
</template>


<script>
import {buyFund} from "@/api";
export default {
  data() {
    return {

      formInline: {
        itemDescription: '国泰利是宝货币',
        orderTime: '2023-11-08 17:06:02',
        orderState: 0,
        tradeMoney: 0.5,
        userId: '212283921',
        fundId: 1,
        transCategory: 'invest',
        share: 1
      }
    }
  },
  methods: {
    onSubmit() {
      buyFund(this.formInline).then((data)=>{
        console.log(data.data.data)
        let page=data.data.data
        window.open("http://localhost:8823/trade/page?payPage="+page)

      })
    }
  }
}
</script>
